package com.ruoyi.back.domain.v3

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.util.*
import javax.persistence.*

@TableName("fly_sensitive_word_v1")
@ApiModel("敏感词")
@Table(name = "fly_sensitive_word_v1")
@Entity
data class SensitiveWord(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("敏感词名称")
    var name: String? = null,

    @ApiModelProperty("敏感词关键字")
    @TableField(exist = false)
    @Transient
    var sensitiveWord: String? = null,

    @ApiModelProperty("启用状态")
    var sensitiveWordStatus: Int? = StatusEnum.OPEN.code,

    @ApiModelProperty("创建时间")
    var createTime: Date? = Date(),

    @ApiModelProperty("创建时间字符串")
    @TableField(exist = false)
    @Transient
    var createTimeStr: String? = null
)

enum class StatusEnum(val code: Int) {
    OPEN(0),
    CLOSE(1)
}